using System;
using System.IO;
using System.Text;

namespace CodeGenerators
{
	internal class TemplateProcessor
	{
		private StringBuilder builder = null;
		public TemplateProcessor(string templateFile)
		{
			StreamReader reader = new StreamReader(templateFile);
			builder = new StringBuilder(
				reader.ReadToEnd()
			);
			reader.Close();
		}
		public string this[ string name ]
		{
			set
			{
				name = "$" + name + "$";
				builder.Replace(
					name,
					value
				);
			}
		}
		public string Render()
		{
			return builder.ToString();
		}
	}
}
